#!/bin/sh

set -eu

jiapkg_build() {
	ncurses_DIR=$($JIAPKG_EXE info --install-dir ncurses)

	export CFLAGS="-I$ncurses_DIR/include"
	export LDFLAGS="-L$ncurses_DIR/lib"
	./configure \
		--with-gnutls=no \
		--prefix="$JIAPKG_INSTALL_DIR"
	make -j"$JIAPKG_JOBS" V=1
}

jiapkg_install() {
	make install
}

case "$1" in
build) jiapkg_build ;;
install) jiapkg_install ;;
esac
